
var app=new Vue({
    el:"#weather",
    data:{
        city:"广州",
        arr:[]
    },
    methods:{
        searchWeather:function(){
            let that=this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city='+this.city)
            .then(function(res){
                that.arr=res.data.data.forecast;
            })
            .catch(function(err){
                console.log(err);
            });
        },
        clickSearch:function(city){
            this.city=city;
            this.searchWeather();
        }

}
});